/**
 * 
 */
package com.demo2do.strawberry.entity.investor;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.demo2do.strawberry.entity.user.member.Member;
import com.demo2do.strawberry.entity.user.profile.Profile;
import com.demo2do.strawberry.entity.user.profile.ProfileAware;

/**
 * @author Downpour
 */
@Entity
@Table(name = "institution")
public class Institution implements ProfileAware {
	
	@Id
	@GeneratedValue
	private Long id;
	
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	private Profile profile;
	
	/** 投资领域 */
	private String focus;
	
	/** 投资阶段 */
	private String phase;
	
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	private Member	member;
	
	@OneToMany(mappedBy = "institution", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private List<Investor> investors;
	
	/**
	 * The default constructor
	 */
	public Institution() {
		
	}
	
	/**
	 * @return
	 */
	public int getInvestorsCount() {
		return this.investors.size();
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @return the profile
	 */
	public Profile getProfile() {
		return profile;
	}

	/**
	 * @return the focus
	 */
	public String getFocus() {
		return focus;
	}

	/**
	 * @return the phase
	 */
	public String getPhase() {
		return phase;
	}

	/**
	 * @return the member
	 */
	public Member getMember() {
		return member;
	}
	
	/**
	 * @return the investors
	 */
	public List<Investor> getInvestors() {
		return investors;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @param profile the profile to set
	 */
	public void setProfile(Profile profile) {
		this.profile = profile;
	}

	/**
	 * @param focus the focus to set
	 */
	public void setFocus(String focus) {
		this.focus = focus;
	}

	/**
	 * @param phase the phase to set
	 */
	public void setPhase(String phase) {
		this.phase = phase;
	}

	/**
	 * @param member the member to set
	 */
	public void setMember(Member member) {
		this.member = member;
	}
	
	/**
	 * @param investors the investors to set
	 */
	public void setInvestos(List<Investor> investors) {
		this.investors = investors;
	}

}